<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="DAO.GroundDao"%>
<%@ page import="VO.Ground"%>
<%@ page import="VO.GroundType,DAO.GroundTypeDao"%>

<%
  String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>球场信息</title>
<link rel="stylesheet" type="text/css" href="css/public.css">
<link rel="stylesheet" type="text/css" href="css/groundmsg.css">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
  <div id="mainbody">
 <div id="title">球场类型信息</div>
  <%
  ArrayList grounds=null; 
  GroundDao gdao = new GroundDao(); 
  grounds = gdao.queryAllGround();//调用queryAllGround()方法
  %>
  <table border=2>
    <tr class="title">
      <td>球场类型</td>
      <td>编号</td>
      <td>球场名</td>
      <td>状态</td>
    </tr>
    <%
      for(int i=0;i<grounds.size();i++){
           Ground groundmsg =(Ground)grounds.get(i);//类型转换
    %>
    <tr>
    <td><%= groundmsg.getTypeid()%></td>
      <td><%= groundmsg.getGid() %></td>
      <td><%= groundmsg.getName() %></td>
      <td><%= groundmsg.getState() %></td>
    </tr>
    <% } %>
    <br>
  </table>
<%
    ArrayList  groundtypes=null;
    GroundTypeDao gtdao = new GroundTypeDao();
    groundtypes =gtdao.findGroundType();//调用findGroundType()方法
%>
<br>
<table border=2>
<tr class="title">
<td>类型</td>
<td>球场数目</td>
</tr>
 <%
   for(int i=0;i<groundtypes.size();i++){
       GroundType groundtype =(GroundType)groundtypes.get(i);
    %>
    <tr>
    <td><%=groundtype.getId() %> </td>
     <td><%=gdao.groundNum(groundtype.getId())%> </td>
     <!-- //调用groundNum()方法 -->
     </tr>
<%
}
 %>
 </table>
</div>

</body>
</html>
